package editor
{
	import flash.geom.ColorTransform;
	import flash.geom.Matrix;
	import flash.geom.Rectangle;
	
	dynamic public class pi_maskInfo extends Object
	{
		public var id: uint;
		public var url: String;
		public var maskClass: Class;
		public var pos: Rectangle;
		public var colors: ColorTransform;
		public var photoMatrix: Object;
		public var price: Number;
		
		public function pi_maskInfo(a_id:int, a_url: String, a_maskClass: Class, 
									a_pos: Rectangle, a_colors: ColorTransform,
									a_photoMatrix: Object = null,
									a_price: Number = 0,
									extProperty: Object=null) {
			super();
			id	= a_id;
			url = a_url;
			maskClass = a_maskClass;
			pos = a_pos;
			colors = a_colors;
			photoMatrix = a_photoMatrix;
			price = a_price?a_price:0;
			if (extProperty) {
				for (var property: String in extProperty) {
					this[property] = extProperty[property];
				}
			}
		}
		
		public function toString(): String {
			var r_colors: String = colors.redMultiplier + ',' + colors.greenMultiplier + ',' + colors.blueMultiplier + ',' + colors.alphaMultiplier + ',' +
								 colors.redOffset + ',' + colors.greenOffset + ',' + colors.blueOffset + ',' + colors.alphaOffset; 
			return 'id=' + id + '&url=' + url.replace('http://', '') + '&class=' + maskClass.toString() +
					'&colors=' + r_colors + '&pos=' +  pos.x + ',' + pos.y + ',' + pos.width + ',' + pos.height + 
					'&gray=' + (this.filters && (this.filters['ColorMatrixFilter'])?1:0);
		}
		
	}
}